import { getCurrentInstance } from 'vue';

// 访问 router、route
export { useRouter, useRoute } from 'vue-router/composables';

// 访问vuex
export const useStore = () => {
  const vm = getCurrentInstance();
  if (!vm) throw new Error('must be called in setup');
  return vm.proxy.$store;
};
